import request from '../utils/request'
import { LoginData } from '../utils/props'

/**
 * 登录
 * return promise
 */
export const login = (data: LoginData) => {
  return request({
    url: '/user/login',
    method: 'POST',
    data
  })
}
/**
 * 登录
 * return promise
 */
export const logout = () => {
  return request({
    url: '/user/logout'
  })
}

/**
 * 获取用户信息
 * return promise
 */
export const getUserInfo = () => {
  return request({
    url: '/user/profile'
  })
}
/**
 * 登录
 * return promise
 */
export const refreshToken = (data: {}) => {
  return request({
    url: '/user/refresh',
    method: 'POST',
    data
  })
}
